#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;

const ll N = 10, INF = 0x3f3f3f3f;

ll n, k;
ll f[10][N * N][1 << N];
ll cnt[1 << N];
vector<ll> ok;

void init()
{
    for (ll st = 0;st < (1 << n);st++) {
        if (((st & (st << 1)) && (st & (st >> 1))) == 0) ok.push_back(st);
        for (ll t = st;t;t -= t & -t) cnt[st]++;
    }
}

void solve()
{
    cin >> n >> k;
    init();
    f[0][0][0] = 1;
    for (ll i = 1;i <= n;i++)
        for (ll st : ok)
            for (ll pre : ok) {
                if (st & (pre | (pre << 1) | (pre >> 1))) continue;
                for (ll j = 0;j <= k;j++)
                    if (j - cnt[st] >= 0) f[i][j][st] += f[i - 1][j - cnt[st]][pre];
            }
    ll ans = 0;
    for (ll st : ok) ans += f[n][k][st];
    cout << ans << '\n';
}

signed main()
{
    //ios::sync_with_stdio(0);
    //cin.tie(0);cout.tie(0);
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
    std::istringstream in(R"()");
    std::cin.rdbuf(in.rdbuf());
#endif
    ll T = 1;
    //cin>>T;
    for (ll i = 1;i <= T;i++) {
        solve();
    }
}